]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
messageTray: Simplify code
authorJasper St. Pierre <jstpierre@mecheye.net>
Mon, 4 Nov 2013 19:16:28 +0000 (14:16 -0500)
committerJasper St. Pierre <jstpierre@mecheye.net>
Mon, 4 Nov 2013 19:16:28 +0000 (14:16 -0500)
If notificationRemoved, then mustClose is true, so we don't need to
double-check for this.

js/ui/messageTray.js

index 1e891faecefe3627349b99f5b5975843e0355bfc..19599441a35fe210c28fab1f0dc7efd9115516af 100644 (file)
@@ -2373,7 +2373,6 @@ const MessageTray = new Lang.Class({
                     this._showNotification();
             }
         } else if (this._notificationState == State.SHOWN) {
-            let pinned = this._pointerInNotification && !this._notificationRemoved;
             let expired = (this._userActiveWhileNotificationShown &&
                            this._notificationTimeoutId == 0 &&
                            !(this._notification.urgency == Urgency.CRITICAL) &&
@@ -2384,9 +2383,9 @@ const MessageTray = new Lang.Class({
             if (mustClose) {
                 let animate = hasNotifications && !this._notificationRemoved;
                 this._hideNotification(animate);
-            } else if (pinned && !this._notification.expanded) {
+            } else if (this._pointerInNotification && !this._notification.expanded) {
                 this._expandNotification(false);
-            } else if (pinned) {
+            } else if (this._pointerInNotification) {
                 this._ensureNotificationFocused();
             }
         }